package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DoseDetailMapper;
import com.ruoyi.system.domain.DoseDetail;
import com.ruoyi.system.service.IDoseDetailService;

import javax.annotation.Resource;

/**
 * 报量单详情Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-30
 */
@Service
public class DoseDetailServiceImpl implements IDoseDetailService {
    @Resource
    private DoseDetailMapper doseDetailMapper;

    /**
     * 查询报量单详情
     *
     * @param id 报量单详情主键
     * @return 报量单详情
     */
    @Override
    public DoseDetail selectDoseDetailById(Long id) {
        return doseDetailMapper.selectDoseDetailById(id);
    }

    /**
     * 查询报量单详情列表
     *
     * @param doseDetail 报量单详情
     * @return 报量单详情
     */
    @Override
    public List<DoseDetail> selectDoseDetailList(DoseDetail doseDetail) {
        return doseDetailMapper.selectDoseDetailList(doseDetail);
    }

    /**
     * 新增报量单详情
     *
     * @param doseDetail 报量单详情
     * @return 结果
     */
    @Override
    public int insertDoseDetail(DoseDetail doseDetail) {
        doseDetail.setCreateTime(DateUtils.getNowDate());
        return doseDetailMapper.insertDoseDetail(doseDetail);
    }

    /**
     * 修改报量单详情
     *
     * @param doseDetail 报量单详情
     * @return 结果
     */
    @Override
    public int updateDoseDetail(DoseDetail doseDetail) {
        doseDetail.setUpdateTime(DateUtils.getNowDate());
        return doseDetailMapper.updateDoseDetail(doseDetail);
    }

    /**
     * 批量删除报量单详情
     *
     * @param ids 需要删除的报量单详情主键
     * @return 结果
     */
    @Override
    public int deleteDoseDetailByIds(Long[] ids) {
        return doseDetailMapper.deleteDoseDetailByIds(ids);
    }

    /**
     * 删除报量单详情信息
     *
     * @param id 报量单详情主键
     * @return 结果
     */
    @Override
    public int deleteDoseDetailById(Long id) {
        return doseDetailMapper.deleteDoseDetailById(id);
    }
}
